/*
 * XML Type:  XEventDelegate
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XEventDelegate
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XEventDelegate(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XEventDelegateImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.widget.XEventDelegate
{
    private static final long serialVersionUID = 1L;
    
    public XEventDelegateImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TYPE$0 = 
        new javax.xml.namespace.QName("", "type");
    private static final javax.xml.namespace.QName PARAS$2 = 
        new javax.xml.namespace.QName("", "paras");
    private static final javax.xml.namespace.QName TARGET$4 = 
        new javax.xml.namespace.QName("", "target");
    private static final javax.xml.namespace.QName ROOT$6 = 
        new javax.xml.namespace.QName("", "root");
    private static final javax.xml.namespace.QName SERVICE$8 = 
        new javax.xml.namespace.QName("", "service");
    
    
    /**
     * Gets the "type" element
     */
    public java.lang.String getType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "type" element
     */
    public org.apache.xmlbeans.XmlString xgetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "type" element
     */
    public void setType(java.lang.String type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TYPE$0);
            }
            target.setStringValue(type);
        }
    }
    
    /**
     * Sets (as xml) the "type" element
     */
    public void xsetType(org.apache.xmlbeans.XmlString type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TYPE$0);
            }
            target.set(type);
        }
    }
    
    /**
     * Gets array of all "paras" elements
     */
    public com.seedwill.xul.core.XPara[] getParasArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PARAS$2, targetList);
            com.seedwill.xul.core.XPara[] result = new com.seedwill.xul.core.XPara[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "paras" element
     */
    public com.seedwill.xul.core.XPara getParasArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(PARAS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "paras" element
     */
    public int sizeOfParasArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PARAS$2);
        }
    }
    
    /**
     * Sets array of all "paras" element
     */
    public void setParasArray(com.seedwill.xul.core.XPara[] parasArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(parasArray, PARAS$2);
        }
    }
    
    /**
     * Sets ith "paras" element
     */
    public void setParasArray(int i, com.seedwill.xul.core.XPara paras)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(PARAS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(paras);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "paras" element
     */
    public com.seedwill.xul.core.XPara insertNewParas(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().insert_element_user(PARAS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "paras" element
     */
    public com.seedwill.xul.core.XPara addNewParas()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().add_element_user(PARAS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "paras" element
     */
    public void removeParas(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PARAS$2, i);
        }
    }
    
    /**
     * Gets the "target" element
     */
    public java.lang.String getTarget()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TARGET$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "target" element
     */
    public org.apache.xmlbeans.XmlString xgetTarget()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TARGET$4, 0);
            return target;
        }
    }
    
    /**
     * True if has "target" element
     */
    public boolean isSetTarget()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TARGET$4) != 0;
        }
    }
    
    /**
     * Sets the "target" element
     */
    public void setTarget(java.lang.String targetValue)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TARGET$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TARGET$4);
            }
            target.setStringValue(targetValue);
        }
    }
    
    /**
     * Sets (as xml) the "target" element
     */
    public void xsetTarget(org.apache.xmlbeans.XmlString targetValue)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TARGET$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TARGET$4);
            }
            target.set(targetValue);
        }
    }
    
    /**
     * Unsets the "target" element
     */
    public void unsetTarget()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TARGET$4, 0);
        }
    }
    
    /**
     * Gets the "root" element
     */
    public com.seedwill.xul.core.XPara getRoot()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(ROOT$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "root" element
     */
    public boolean isSetRoot()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ROOT$6) != 0;
        }
    }
    
    /**
     * Sets the "root" element
     */
    public void setRoot(com.seedwill.xul.core.XPara root)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(ROOT$6, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XPara)get_store().add_element_user(ROOT$6);
            }
            target.set(root);
        }
    }
    
    /**
     * Appends and returns a new empty "root" element
     */
    public com.seedwill.xul.core.XPara addNewRoot()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().add_element_user(ROOT$6);
            return target;
        }
    }
    
    /**
     * Unsets the "root" element
     */
    public void unsetRoot()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ROOT$6, 0);
        }
    }
    
    /**
     * Gets the "service" element
     */
    public java.lang.String getService()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SERVICE$8, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "service" element
     */
    public org.apache.xmlbeans.XmlString xgetService()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SERVICE$8, 0);
            return target;
        }
    }
    
    /**
     * True if has "service" element
     */
    public boolean isSetService()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SERVICE$8) != 0;
        }
    }
    
    /**
     * Sets the "service" element
     */
    public void setService(java.lang.String service)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SERVICE$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SERVICE$8);
            }
            target.setStringValue(service);
        }
    }
    
    /**
     * Sets (as xml) the "service" element
     */
    public void xsetService(org.apache.xmlbeans.XmlString service)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SERVICE$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(SERVICE$8);
            }
            target.set(service);
        }
    }
    
    /**
     * Unsets the "service" element
     */
    public void unsetService()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SERVICE$8, 0);
        }
    }
}
